Skip to content

fix(fleet-queue): make the client surface compile on its own (#13078) - #13164

Open
dezren39 wants to merge 1 commit into
mainfrom
xaltha/13078-client-feature
Open

dezren39 wants to merge 1 commit into
mainfrom
xaltha/13078-client-feature

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Closes #13078

Problem

pkgs/fleet/crates/fleet-queue/Cargo.toml declares the chunked_list integration test with required-features = ["client"], but the crate did not compile with the client feature alone:

error[E0433]: cannot find `turso_queue` in the crate root
   --> crates/fleet-queue/src/client/commands_lifecycle.rs:384:20
error[E0433]: cannot find `validate` in the crate root
   --> crates/fleet-queue/src/client/support.rs:682:12
error: could not compile `fleet-queue` (lib) due to 3 previous errors

(reproduced on main fa75486a0 before this change — 2× turso_queue, 1× validate.)

Client code referenced crate::turso_queue::BATCH_CLAIM_MAX and crate::validate::validate_not_before, but both modules were gated on queue-broker. The declared feature contract was right; the gating was wrong, so this PR fixes the gating and leaves Cargo.toml untouched.

Fix (4 files, feature wiring + one constant move)

  • BATCH_CLAIM_MAX moves to the crate root (src/lib.rs), with its feat(queue): batch claim (--count N) + per-item dedicated sub-task dispatch #8217 rationale doc. Both surfaces share the bound: the client validates --count locally so a bad value fails instantly, and the broker enforces the same value on the wire. turso_queue::lifecycle re-exports it (pub use crate::BATCH_CLAIM_MAX;), so turso_queue::BATCH_CLAIM_MAX and the broker's parse path keep working unchanged. The client sites in client/commands_lifecycle.rs and the client.rs tests now use crate::BATCH_CLAIM_MAX.
  • validate compiles for either surface: its lib.rs gate becomes any(feature = "client", feature = "queue-broker"). It is the shared validation library (the broker validates whole packets; the client validates individual flag values such as --not-before against the same rules) and it depends only on serde_json — never on a broker-only dependency — so no code had to move.

Verification — remote dispatch (Fleet command run)

Run: https://github.com/dezren39/fleet/actions/runs/45146692567
(dezren39/fleet#45146692567, handle fp_3e812705de06de97cdda5887ba82ed75, toolchain 1.99.1 as in fleet-rust-tests.yml; an earlier run, 45145124821, failed before any code ran — cargo not on the container PATH — and is superseded by this run, whose command bootstraps the toolchain.)

One command chain, exit 0:

  • cargo check -p fleet-queue for every feature combination: (none), client, secrets-broker, client,secrets-broker, queue-broker, all-features — all pass (client-only failed with the 3 E0433s before).
  • cargo test -p fleet-queue --features client --test chunked_list --locked — 2 passed (acceptance 1: exactly the declared required-features).
  • cargo test -p fleet-queue --features client,queue-broker --locked — lib 526 passed, 0 failed (acceptance 2: no regression).
  • cargo test -p fleet-queue --all-features --locked — lib 549 passed, 0 failed, incl. broker_bin_args.
  • cargo test -p fleet-queue --features client --locked — lib 332 passed, 0 failed, chunked_list 2, person_wait_cli 5, doctests ok.

20 test-result lines in the run log, all ok, 0 failed anywhere.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T09:34:20Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch/workspace/github-work/code",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch/workspace/github-work/code",
      "repo": "developing-today/code",
      "branch": "xaltha/9602-3819-note-policy-restart",
      "sha": "bd7252dd009d4cbe01c53bdefa3a3bfac5094bd9"
    },
    "auth_subject": "xaltha",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The chunked_list test declares required-features = ["client"], but the crate did not compile with client alone: client code referenced crate::turso_queue::BATCH_CLAIM_MAX and crate::validate::validate_not_before, and both modules were gated on queue-broker.

- BATCH_CLAIM_MAX moves to the crate root (both surfaces share the bound: the client validates --count locally, the broker enforces the same value on the wire); turso_queue::lifecycle re-exports it so turso_queue::BATCH_CLAIM_MAX keeps working.
- validate compiles for either surface (any(client, queue-broker)): it is the shared validation library and depends only on serde_json.

No Cargo.toml change: the declared required-features were right, the gating was wrong.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 302cb82e-74e5-41b9-84b4-2e0ab8d17b3f
Commits

Reviewing files that changed from the base of the PR and between 96c8407 and 28ddf5a.

Files selected for processing: 4

  • pkgs/fleet/crates/fleet-queue/src/client.rs
  • pkgs/fleet/crates/fleet-queue/src/client/commands_lifecycle.rs
  • pkgs/fleet/crates/fleet-queue/src/lib.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue/lifecycle.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T09:36:01.379923Z 28ddf5a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fleet-queue: chunked_list declares required-features=[client] but the crate does not compile with client alone

1 participant